Ports command line argument handling for proxy and handler to Rust#48232
Merged
serra-fastly merged 58 commits intomainfrom Aug 18, 2025
Merged
Ports command line argument handling for proxy and handler to Rust#48232serra-fastly merged 58 commits intomainfrom
serra-fastly merged 58 commits intomainfrom
Conversation
deg4uss3r
reviewed
Jul 9, 2025
Collaborator
deg4uss3r
left a comment
There was a problem hiding this comment.
PR looks good! Minus one debugging statement left in I think this is ready to test on a node for correctness.
8319e99 to
ce7de89
Compare
deg4uss3r
approved these changes
Jul 30, 2025
Collaborator
deg4uss3r
left a comment
There was a problem hiding this comment.
Everything here looks good to me, going to tag in Justin though for a more thorough review of the c++ pieces.
jkarneges
reviewed
Aug 6, 2025
…te struct issue in bindgen for handler and proxy
jkarneges
reviewed
Aug 13, 2025
jkarneges
reviewed
Aug 15, 2025
9f4e249 to
f32d28f
Compare
jkarneges
reviewed
Aug 16, 2025
jkarneges
approved these changes
Aug 18, 2025
serra-fastly
added a commit
that referenced
this pull request
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is a part of the transition from C++ to Rust.
Argument handling has been collapsed into core/[handler/proxy]argsdata.cpp and core/[handler/proxy]cliargs.rs for C++ and Rust respectively. Old argument parsing logic was removed from the C++ modules. Runner was updated with the new command line values to standardize tags. ArgsData in Runner was updated to RunnerArgsData for differentiation.
In the Rust modules, handler and proxy use clap to parse arguments into CliArgs, convert to its FFI struct equivalent [Handler/Proxy]CliArgsFfi, and then call handler_main and proxy_main respectively with the [Handler/Proxy]CliArgsFfi variable being passed in as the argument. cbindgen creates a binding for [Handler/Proxy]CliArgsFfi within "rust/bindings.h" for use by C++ at compilation time. Then in the C++ modules, the [Handler/Proxy]CliArgsFfi gets loaded into an ArgsData struct for use with QT types and loaded into the Settings struct.
cbindgen was used to pass the data through because the linker had trouble with cxx due to QT (that wasn't able to be resolved with cxx-qt), but it'll be good to use cxx in the future for security and stability to create safe bindings (vs the unsafe bindings from cbindgen).
I've created unit testing for both the Rust modules that send the arguments within cliargs.rs and the C++ modules that receive the modules within [handler/proxy]argstest.cpp. Both test with the same values and the same two use cases— all arguments are set and no arguments are set.
Tested on a canary node (lck) on 08/08/2025.